<?php 
include 'visit.phtml';
?>


<div id="<?php echo $this->year?>" class="year_box"></div>
 <?php foreach ($this->friends as $friend):?>
 	<div id="<?php echo $this->page?>" class="message_box" 
 	
 	style="
width: 120px;
height: 165px; 
float: left; margin: 20px; 
text-align: center;

">
    	
        <?php $cur_user_id = Zend_Auth::getInstance()->getIdentity()->id;?>
        
        
        <?php 
        
        if($this->year == 1000){
                 $user_id_model = $friend->id;
         }else{
            	$user_id_model = $friend->user_id;
         }?>
        
    	<?php $model_user = new Model_User($user_id_model)?>
    	
            	<div style="
                    height: 125px; 
                    ">
            	<a
            	href="<?php
                echo $this->url(array('controller' => $model_user->login, 'action' => null, 'request'=>null),"default")?>"><?php
                ?>
                		<?php if ($model_user->avatar == null) : ?> 
                			<img src="<?php echo $this->baseUrl('img' . DIRECTORY_SEPARATOR . $model_user->gender)?>sex_ava.png"   width="120" alt="avatar image"> 
                		<?php else : ?> 
                			<img src="<?php echo $this->baseUrl('upload' . DIRECTORY_SEPARATOR . 'thumb'.DIRECTORY_SEPARATOR . $model_user->avatar)?>" alt="avatar image"> 
                		<?php endif;?>
                </a> 
                
            	</div>
                <a 
            	href="<?php
                echo $this->url(array('controller' => $model_user->login, 'action' => null, 'request'=>null),"default")?>">
                <?php echo $model_user->login?>
                </a> 
                <br/>
                
                
                
                    <?php if($model_user->checkOnline($user_id_model)){
                	echo $this->translate("Online");
                		}else{
                	echo $this->translate("Offline");
                		}
                ?>
    	
    	
        <br/>
     </div>
    <?php endforeach;?>
    <div id="last_msg_loader"></div>
